@extends('layouts.admin_panel')
@section('style')
    <link rel="stylesheet" type="text/css" href="/assets_admin_panel/global/plugins/select2/select2.css"/>
    <link rel="stylesheet" type="text/css" href="/assets_admin_panel/global/plugins/icheck/skins/all.css" />
    <link rel="stylesheet" type="text/css" href="/assets_admin_panel/global/plugins/bootstrap-datepicker/css/datepicker3.css"/>
@stop

@section('content')
    <!-- BEGIN PAGE HEADER-->
    <h3 class="page-title"> Sửa danh mục</h3>
    <div class="page-bar">
        <ul class="page-breadcrumb">
            <li>
                <i class="fa fa-home"></i>
                <a href="index.html">Home</a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="#">Danh mục</a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="#">Sửa danh mục</a>
            </li>
        </ul>
    </div>
    <!-- END PAGE HEADER-->
    
    <div class="row">
        <div class="col-md-12">
            <div class="portlet box red-sunglo">
                <div class="portlet-title">
                    <div class="caption">
                        Sửa danh mục
                    </div>
                    <div class="tools">
                        <a class="collapse" href="javascript:;" data-original-title="" title=""> </a>
                        <a class="config" data-toggle="modal" href="#portlet-config" data-original-title="" title=""> </a>
                        <a href="javascript:;" class="reload"></a>
                        <a href="javascript:;" class="remove"></a>
                    </div>
                </div>
                <div class="portlet-body">
                    {{ Form::model($category, array(
			            'route' => array('admin.category.update', $category->id),
			            'id' => 'form-category-edit',
			            'class' => 'form-horizontal',
			            'method' => 'put',
			            'data-remote' => 'true',
			            'data-type' => 'json'
			        )) }}
                    
                    <div class="form-group"> 
                        <div class="col-sm-6">
                            <a href="{{ route('admin.user.index') }}" class="btn default"><i class=' icon-action-undo'></i> Quay lại</a>
                        </div>
                        <div class="col-sm-6">
                            {{ Form::button("<i class='icon-layers'></i> Lưu", array('type' => 'submit', 'class' => 'btn btn-success pull-right')) }}
                        </div>
                    </div>
                    <div class="form-group">
		                <div class="col-sm-6">
                            {{Form::select('parent', CommonHelper::parentOptions(), $category->parent_id, array('class' => 'form-control has-custom-select') )}}
                        </div>
		            </div>
                    <div class="tabbable-custom" style="height: 570px; margin-top: 20px;">
	                    <ul class="nav nav-tabs">
						    <li class="active"><a href="#tab-en" data-toggle="tab">English</a></li>
						    <li><a href="#tab-vi" data-toggle="tab">Vietnamese</a></li>
						</ul>
						
						<!-- Tab panes -->
						<div class="tab-content" style="height: 570px;">
						    <div class="tab-pane active" id="tab-en">      
						        <div class="form-group col-sm-12 required">
						            {{ Form::label('en_title', 'Tên danh mục', array('class' => 'control-label')) }}
						            <div>
						                {{ Form::text('en_title', $category->name_en, array('class' => 'form-control auto-focus')) }}
						            </div>
						        </div>
						        <div class="form-group col-sm-12">
						            {{ Form::label('en_content', 'Chú thích thêm', array('class' => 'control-label')) }}
						            <div>
						                {{ Form::textarea('en_content', $category->description_en, array('class' => 'form-control ckeditor', 'id' => 'create-content-en')) }}
						            </div>
						        </div>
						        <div class='clear'></div>
						    </div>
						    
						    <div class="tab-pane" id="tab-vi">
						        <div class="form-group col-sm-12 required">
						            {{ Form::label('vi_title', 'Tên danh mục', array('class' => 'control-label')) }}
						            <div>
						                {{ Form::text('vi_title', $category->name_vi, array('class' => 'form-control')) }}
						            </div>
						        </div>
						        <div class="form-group col-sm-12">
						            {{ Form::label('vi_content', 'Chú thích thêm', array('class' => 'control-label')) }}
						            <div>
						                {{ Form::textarea('vi_content', $category->description_vi, array('class' => 'form-control ckeditor', 'id' => 'create-content-vi')) }}
						            </div>
						        </div>
						        <div class='clear'></div>
						    </div>
						</div>
                    </div>
                    {{ Form::close() }}  
                </div>
            </div>
        </div>
    </div>
@stop

@section('scripts')
    <script type="text/javascript" src="/assets_admin_panel/global/plugins/select2/select2.min.js"></script>
    <script type="text/javascript" src="/assets_admin_panel/global/plugins/ckeditor/ckeditor.js"></script>
    <script type="text/javascript" src="/assets_admin_panel/admin/layout/scripts/core.js"></script>
    <script type="text/javascript" src="/assets_admin_panel/admin/layout/scripts/elements/category.js"></script>
@stop